package exception;

public class TryCatchDemo1 {
    public static void main(String[] args) {
        String line = null;
       //String line = "";
       // String line = "a";
        try {
            System.out.println(Integer.parseInt(line));
            System.out.println(line.length());
           //System.out.println(line.charAt(0));
            System.out.println("!!!!!!!!!!!!!");
        } catch (StringIndexOutOfBoundsException e){
            System.out.println("字符串下标越界异常，并且解决了");
        } catch (NullPointerException e) {
            System.out.println("空指针异常，并且解决了");
        }catch (NumberFormatException e) {
            System.out.println("字符格式异常，并且解决了");
        }

    }
}
